<template>
    <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" class="namtc-leftmenu-tree" accordion
    ></el-tree>
</template>
<script>
    export default {
        data() {
            return {
                data: [{
                    label: '系统管理',
                    children: [{
                        label: '主页',
                        url: 'primary/homepage'
                    },
//                      {
//                        label: '我的最爱',
//                        url: 'primary/individual'
//                    },
                      {
                        label: '个人账户信息',
                        url: 'primary/information'
                    },
                    {
                        label: '论坛',
                    },
                     {
                        label: '仪表盘',
                        url: 'dashboard/traineeCount'
                    }]
                }, {
                    label: '学员',
                    children: [{
                        label: '添加学员',
                        url: 'trainee/add'
                    }, {
                        label: '高级搜索',
                        url: 'trainee/search'
                    },{
                    	label: '意向学员',
                    	url: 'trainee/intention'
                    }]
                }, {
                    label: '客户',
                    children: [{
                        label: '新建客户信息',
                        url: 'customer/add'
                    }, {
                        label: '高级搜索',
                        url: 'customer/search'
                    },{
                    	label: '意向客户',
                    	url: 'customer/customerIntention'
                    }]
                }, {
                    label: '培训',
                    children: [{
                        label: '课程',
                        children: [{
                            label: '培训日历',
                            url: 'course/calendar'
                        }, {
                            label: '课程列表',
                            url: 'course/list'
                        }, {
                            label: '培训计划',
                            url: 'training/list'
                        }]
                    }, {
                        label: '题库',
                        children: [{
                            label: '添加试题',
                            url: 'question/add'
                        }, {
                            label: '搜索试题',
                            url: 'question/search'
                        }, {
                            label: '关键字',
                            url: 'question/keyword'
                        }]
                    }, {
                        label: '新项目开发',
                        url: 'training/addProject'
                    }]
                }, {
                    label: '运营',
                    children: [{
                        label: '供应商管理',
                        children: [{
                            label: '酒店',
                            url: 'operate/supplier/hotel'
                        }, {
                            label: '其他',
                            url: 'operate/supplier/other'
                        }]
                    }, {
                        label: '资产',
                        children: [{
                            label: '培训设施和设备',
                            children: [{
                                label: '培训教室',
                                url: 'operate/assets/facilities/classroom'
                            }, {
                                label: '模拟器',
                                url: 'operate/assets/facilities/simulator'
                            }, {
                                label: '书籍光盘资料',
                                url: 'operate/assets/facilities/book'
                            }, {
                                label: '教材',
                                url: 'operate/assets/facilities/textbook'
                            }]
                        }, {
                            label: '房屋',
                            url: 'operate/assets/house'
                        }, {
                            label: '办公用品',
                            url: 'operate/assets/office'
                        }, {
                            label: '运输设备',
                            url: 'operate/assets/transport'
                        }, {
                            label: '其他',
                            url: 'operate/assets/other'
                        }]
                    }, {
                        label: '人资',
                        children: [{
                            label: '员工管理',
                            url: 'operate/manpower/employee'
                        }, {
                            label: '考勤',
                            url: 'operate/manpower/timeSheet'
                        }, {
                            label: '课酬统计',
                            url: 'operate/manpower/courseMoney'
                        }, {
                            label: '招聘/入职手续',
                            url: 'operate/manpower/recruit'
                        }]
                    },{
                        label: '财务',
                        children: [{
                            label: '微信缴费记录',
                            url: 'operate/finance/wxPayRecord'
                        }, ]
                    }]
                }, {
                    label: '管理员',
                    children: [{
                        label: '角色信息',
                        children: [{
                            label: '用户管理',
                            url: 'system/user'
                        }, {
                            label: '分组管理',
                            url: 'system/group'
                        }]
                    },{
                        label: '官网维护',
                        children: [{
                            label: '首页轮播图',
                            url: 'system/webHome'
                        }, {
                            label: '关于我们',
                            url: 'system/webAbout'
                        }, {
                            label: '新闻动态',
                            url: 'system/webNews'
                        }, {
                            label: '联系我们',
                            url: 'system/webContact'
                        }]
                    },{
                    	label: '设置微信支付',
                    	url: 'system/WeChatPay'
                    }]
                }],
                defaultProps: {
                    children: 'children',
                    label: 'label'
                }
            };
        },
        methods: {
            handleNodeClick(data) {
                if (data.label === '仪表盘') {
                    window.open(SITE + data.url)
                    return
                }
                if (data.label === '论坛') {
                    this.apiPost('Forum/push').then(res => {
                        if (res.error === 0) {
                        window.open('http://bbs.namtc.com.cn/index.php/admin/User/Login?id=' + res.msg);
                        } else {
                        _g.toastMsg('error', res.msg);
                        }
                    });
                    return
                }
                if (data.url) {
                    router.push('/' + data.url)
                }
            }
        }
    };
</script>
<style scoped>


</style>
